﻿
function checkvalue() 
{   
    var intName; var inEmail; var inTitle; var inContent; var inCode; var inCapcha;
    intName = document.getElementById("ctl00_ContentPlaceMain_Txtname").value;
    inEmail = document.getElementById("ctl00_ContentPlaceMain_Txtemail").value;
    inTitle = document.getElementById("ctl00_ContentPlaceMain_Txttitle").value;
    inContent = document.getElementById("ctl00_ContentPlaceMain_txtcontent").value;
    if(intName == '' || intName.length == 0 || inTitle == '' || inTitle.length == 0 || inContent == '' || inContent.length == 0 ) 
    { alert('Vui lòng cung cấp đầy đủ thông tin !'); return false;}
    if (inEmail.length == 0 || isEmail(inEmail) == false){ alert('Địa chỉ email không hợp lệ !'); return false;}
    return true;
 }

function isEmail(string) { if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1){return true;}  return false;}